import tensorflow as tf
import tensorflow_hub as hub

num_classes = 10

# 使用 hub.KerasLayer 组件待训练模型
new_model = tf.keras.Sequential([
    hub.KerasLayer("https://hub.tensorflow.google.cn/google/tf2-preview/inception_v3/feature_vector/4",
                   output_shape=[2048], trainable=False),
    tf.keras.layers.Dense(num_classes, activation='softmax')
])
new_model.build([None, 299, 299, 3])

# 输出模型结构
new_model.summary()

# 后面就是正常的类似原来的训练了
# ...
# ...
